﻿package com.wandian.view.mediator
{
	import com.wandian.controller.CLZNoticeName;
	import com.wandian.data.GameData;
	import com.wandian.model.InRoomPlayerDataProxy;
	import com.wandian.model.vo.PlayerVo;
	import com.wandian.util.CLZButton;
	import com.wandian.util.CLZSelectButton;
	import com.wandian.util.CLZSlide;
	import com.wandian.util.CLZTiming;
	import com.wandian.util.GlowFilterManage;
	import com.wandian.view.components.ui.CountMoney;
	import com.wandian.view.components.ui.SoundManage;

	import flash.display.MovieClip;
	import flash.events.Event;
	import flash.events.MouseEvent;

	import org.puremvc.as3.interfaces.*;
	import org.puremvc.as3.patterns.mediator.*;

	/**
	* @author long
	* @QQ 108232706
	* @version 1.0
	*/
	public class OperateMediator extends Mediator
	{
		private var _filter:GlowFilterManage;
		/**
		 * 当前托管操作类型
		 * <br/>托管:1,自动，看牌/放弃，2,自动看牌,3，自动跟任何
		 * @default
		 */
		private var _nAuto:uint=0;
		private var _countMoney:CountMoney;
		/**
		 * 一开始200万
		 * @default
		 */
		private var minChip:uint;
		/**
		 * 最小加注，大盲，200万
		 * @default
		 */
		private var minRaise:uint;
		/**
		 * 最大加注
		 * @default
		 */
		private var maxChip:uint;
		private var minBlind:uint;
		/**
		 * 身上的筹码
		 * @default
		 */
		private var nStake:uint;
		/**
		 * 游戏一开始，给自动下的金额
		 * @default
		 */
		private var pevMoney:uint;
		private var _slide:CLZSlide;
		private var nBuyInscale:uint;
		private var _global:GameData;
		private var _inRoomData:InRoomPlayerDataProxy;
		private var clzSelectButton:CLZSelectButton;
		private var playerVo:PlayerVo;
		private var step:int;
		public static const NAME:String="OperateMediator";

		public function OperateMediator(viewComponent:Object=null)
		{
			this._filter=GlowFilterManage.getInstance();
			this._countMoney=CountMoney.getInstance();
			this._global=GameData.getInstance();
			super(NAME, viewComponent);
			this._inRoomData=facade.retrieveProxy(InRoomPlayerDataProxy.NAME) as InRoomPlayerDataProxy;
			this.init();
			return;
		}

		private function init():void
		{
			CLZButton.setButton(this.mcOperate.fold_btn, GameData.tip["FOLD"]);
			CLZButton.setButton(this.mcOperate.check_btn, GameData.tip["CHECK"]);
			CLZButton.setButton(this.mcOperate.call_btn, GameData.tip["CALL"]);
			CLZButton.setButton(this.mcOperate.raise_btn, GameData.tip["RAISE"]);
			CLZButton.setButton(this.mcOperate.allIn_btn, GameData.tip["ALLIN"]);
			CLZButton.setButton(this.mcOperate.fastBuyIn_btn);
			this.clzSelectButton=new CLZSelectButton();
			this.clzSelectButton.setButton([[this.mcOperate.autoCheckFold_btn, false, GameData.tip["FOLD_CHECK_AUTO"], ""], [this.mcOperate.autoCheck_btn, false, GameData.tip["CHECK_AUTO"], ""], [this.mcOperate.autoAllCall_btn, false, GameData.tip["CALL_ALL_AUTO"], ""]]);
			this.mcOperate.fold_btn.addEventListener(MouseEvent.CLICK, this.clickFoldHandler);
			this.mcOperate.call_btn.addEventListener(MouseEvent.CLICK, this.clickCallHandler);
			this.mcOperate.check_btn.addEventListener(MouseEvent.CLICK, this.clickLookHandler);
			this.mcOperate.raise_btn.addEventListener(MouseEvent.CLICK, this.clickAddCallHandler);
			this.mcOperate.allIn_btn.addEventListener(MouseEvent.CLICK, this.clickAllCallHandler);
			this.mcOperate.autoCheckFold_btn.addEventListener(Event.CHANGE, this.onChangeAutoHandler);
			this.mcOperate.autoCheck_btn.addEventListener(Event.CHANGE, this.onChangeAutoHandler);
			this.mcOperate.autoAllCall_btn.addEventListener(Event.CHANGE, this.onChangeAutoHandler);
			this._slide=new CLZSlide(this.mcOperate.slide_mc.btn, this.mcOperate.slide_mc.bg, this.mcOperate.slide_mc.sub_btn, this.mcOperate.slide_mc.add_btn);
			this._slide.width=this.mcOperate.slide_mc.bg.width - this.mcOperate.slide_mc.btn.width;
			this._slide.addEventListener(Event.CHANGE, this.changeSlideHandler);
			this.hideBtn();
			this.mcOperate.fastBuyIn_btn.addEventListener(MouseEvent.CLICK, this.fastBuyInHandler);
			return;
		}

		private function onChangeAutoHandler(event:Event):void
		{
			var mcBtn:*=event.target as MovieClip;
			if (!mcBtn.isSelected)
			{
				this._nAuto=0;
				return;
			}
			switch (mcBtn.name)
			{
				case "autoCheckFold_btn":
				{
					this._nAuto=1;
					break;
				}
				case "autoCheck_btn":
				{
					this._nAuto=2;
					break;
				}
				case "autoAllCall_btn":
				{
					this._nAuto=3;
					break;
				}
				default:
				{
					break;
				}
			}
			return;
		}

		private function changeSlideHandler(event:Event):void
		{
			CLZButton.updateMcText(this.mcOperate.raise_btn, GameData.tip["RAISE"] + " " + this._countMoney.countStrWMoney(this._slide._value));
			return;
		}

		private function operatePlayer(_minChip:uint, _maxChip:uint, _minRaise:uint, _nStake:uint, _pevMoney:uint, _maxStake:uint):void
		{
			trace(this.playerVo.name + "----------->>最小叫:" + _minChip + " 最大叫:" + _maxChip + " 最小加注:" + _minRaise + " 筹码:" + _nStake + " 先前下注:" + _pevMoney + " 最大筹码:" + _maxStake);
			this.hideAutoBtn();
			this.nStake=_nStake;
			this.minChip=_minChip;
			this.maxChip=_maxChip;
			this.minRaise=_minRaise;
			this.pevMoney=_pevMoney;
			var _loc_7:*=int(_maxStake / 2 / 100);
			this.nBuyInscale=_loc_7 > 0 ? (_loc_7) : (1);
			if (this.minChip == 0)
			{
				this.showLookCard();
			}
			else
			{
				this.showCallCard();
			}
			CLZButton.updateMcText(this.mcOperate.call_btn, GameData.tip["CALL"] + " " + this._countMoney.countStrWMoney(_minChip));
			CLZButton.updateMcText(this.mcOperate.allIn_btn, GameData.tip["ALLIN"]);
			return;
		}

		private function clickLookHandler(event:MouseEvent):void
		{
			this.hideBtn();
			var data:Object={sid: this.playerVo.seatId, type: GameData.CHECK, chip: 0,step:step};
			this.sendNotification(CLZNoticeName.CHECK, data);
			return;
		}

		private function clickFoldHandler(event:MouseEvent):void
		{
			this.hideBtn();
			var data:Object={sid: this.playerVo.seatId, type: GameData.FOLD, chip: 0,step:step};
			this.sendNotification(CLZNoticeName.FLOD, data);
			return;
		}

		private function clickAllCallHandler(event:MouseEvent):void
		{
			this.hideBtn();
			var data:Object={sid: this.playerVo.seatId, type: GameData.ALLIN, chip: 0,step:step};
			this.sendNotification(CLZNoticeName.ALLIN, data);
			return;
		}

		private function clickCallHandler(event:MouseEvent):void
		{
			this.callHandler(this.minChip);
			return;
		}

		/**
		 * 跟注
		 * @param chip
		 */
		private function callHandler(chip:int):void
		{
			this.hideBtn();
			if (chip < this.minChip)
			{
				chip=this.minChip;
			}
			var data:*=new Object();
			data={sid: this.playerVo.seatId, type: GameData.CALL, chip: 0,step:step};
			this.sendNotification(CLZNoticeName.CALL, data);
			return;
		}

		private function clickAddCallHandler(event:MouseEvent):void
		{
			this.raiseChip(this._slide._value);
			return;
		}

		/**
		 * 加注
		 * @param chip 加注的金额
		 */
		private function raiseChip(chip:int):void
		{
			this.hideBtn();
			if (chip < this.minRaise)
			{
				chip=this.minRaise;
			}
			if (chip > this.maxChip)
			{
				chip=this.maxChip;
			}
			var data:*=new Object();
			data={sid: this.playerVo.seatId, type: GameData.RAISE, chip: chip,step:step};
			this.sendNotification(CLZNoticeName.RAISE, data);
			return;
		}

		private function showLookCard():void
		{
			if (this._nAuto > 0)
			{
				this.clickLookHandler(null);
				return;
			}
			this.showBtn();
			//跟注
			this.mcOperate.call_btn.visible=false;
			this.isShowAllCall();
			return;
		}

		/**
		 * 需要加注的情况下
		 */
		public function showCallCard():void
		{
			if (this._nAuto == 1)
			{
				this.clickFoldHandler(null);
				return;
			}
			this.showBtn();
			//钱不够，跟注不了
			if (this.nStake + this.pevMoney < this.minChip)
			{
				this.mcOperate.call_btn.mouseEnabled=false;
				this.mcOperate.call_btn.filters=this._filter.getGrayscale();
			}
			else if (this._nAuto == 3)
			{
				this.clickCallHandler(null);
				return;
			}
			this.mcOperate.check_btn.mouseEnabled=false;
			this.mcOperate.check_btn.filters=this._filter.getGrayscale();
			this.mcOperate.fold_btn.mouseEnabled=true;
			this.mcOperate.fold_btn.filters=[];
			this.isShowAllCall();
			return;
		}

		private function isShowAllCall():void
		{
			if (this.nStake + this.pevMoney > this.minRaise)
			{
//				if (this.minRaise != 0)
//				{
				//minChip,200，minRaise 400
				if (this.maxChip != this.minRaise)
				{
					this._slide.setMinMax(this.minRaise, this.maxChip, this.nBuyInscale);
					if (this._nAuto == 3)
					{
						this.clickAddCallHandler(null);
						return;
					}
				}
				else
				{
					this._slide.hide();
					CLZButton.updateMcText(this.mcOperate.raise_btn, GameData.tip["RAISE"]);
					//加注
					this.mcOperate.raise_btn.mouseEnabled=false;
					this.mcOperate.raise_btn.filters=this._filter.getGrayscale();
				}
			}

			else
			{
				this._slide.hide();
				CLZButton.updateMcText(this.mcOperate.raise_btn, GameData.tip["RAISE"]);
				//加注
				this.mcOperate.raise_btn.mouseEnabled=false;
				this.mcOperate.raise_btn.filters=this._filter.getGrayscale();
			}
			//如果身上的筹码加之前的筹码 小于最大筹码，全压
			if (this.maxChip == this.minRaise)
			{
				if (this.nStake + this.pevMoney <= this.maxChip)
				{
					this.mcOperate.allIn_btn.visible=true;
					if (this._nAuto == 3)
					{
						this.clickAllCallHandler(null);
						return;
					}
				}
			}
			else
			{
				this.mcOperate.allIn_btn.visible=false;
			}
			return;
		}

		private function showBtn():void
		{
			this.mcOperate.check_btn.visible=true;
			this.mcOperate.call_btn.visible=true;
			this.mcOperate.raise_btn.visible=true;
			this.mcOperate.fold_btn.visible=true;
			this.mcOperate.slide_mc.visible=true;
			this.mcOperate.check_btn.mouseEnabled=true;
			this.mcOperate.call_btn.mouseEnabled=true;
			this.mcOperate.raise_btn.mouseEnabled=true;
			this.mcOperate.fold_btn.mouseEnabled=true;
			this.mcOperate.slide_mc.mouseEnabled=true;
			this.mcOperate.check_btn.filters=null;
			this.mcOperate.call_btn.filters=null;
			this.mcOperate.raise_btn.filters=null;
			this.mcOperate.fold_btn.filters=null;
			this.mcOperate.slide_mc.filters=null;
			return;
		}

		/**
		 * 隐藏4操作按钮,显示4托管按钮
		 * @param isShowAuto
		 */
		private function hideBtn(isShowAuto:Boolean=true):void
		{
			var curPlayerVo:PlayerVo=null;
			this._nAuto=0;
			this.mcOperate.check_btn.visible=false;
			this.mcOperate.call_btn.visible=false;
			this.mcOperate.raise_btn.visible=false;
			this.mcOperate.allIn_btn.visible=false;
			this.mcOperate.fold_btn.visible=false;
			this.mcOperate.slide_mc.visible=false;
			if (isShowAuto)
			{
				if (this._global.seatId != 0)
				{
					curPlayerVo=this._inRoomData.getSitPlayerBySeatId(this._global.seatId);
					if (curPlayerVo.state == GameData.PLAYING_GAME)
					{
						if (curPlayerVo.lastAction < 10)
						{
							CLZTiming.add(0.2, this.showAutoBtn);
							return;
						}
					}

				}
			}
			else
			{
				CLZTiming.remove(this.showAutoBtn);
			}
			this.hideAutoBtn();
			return;
		}

		private function showAutoBtn():void
		{
			if (this._global.seatId == 0)
			{
				return;
			}
			this.clzSelectButton.init();
			this.mcOperate.autoCheck_btn.visible=true;
			this.mcOperate.autoCheckFold_btn.visible=true;
			this.mcOperate.autoAllCall_btn.visible=true;
			return;
		}

		private function hideAutoBtn():void
		{
			CLZTiming.remove(this.showAutoBtn);
			this.mcOperate.autoCheck_btn.visible=false;
			this.mcOperate.autoCheckFold_btn.visible=false;
			this.mcOperate.autoAllCall_btn.visible=false;
			return;
		}

		override public function onRegister():void
		{
			return;
		}

		override public function listNotificationInterests():Array
		{
			return [CLZNoticeName.SET_ROOM_WINDOS_CLOSE,CLZNoticeName.BUY_IN_WINDOS_CLOSE, CLZNoticeName.SET_ROOM_WINDOS_SHOW, CLZNoticeName.BUY_IN_WINDOS_SHOW, CLZNoticeName.SITDOWN_ERR, CLZNoticeName.SETROOMINFO_RSP, CLZNoticeName.OPERATION_PALYER, CLZNoticeName.GAME_OVER, CLZNoticeName.OPERATION_SUCC, CLZNoticeName.SNAPCARDS_FLOP, CLZNoticeName.SNAPCARDS_RIVER, CLZNoticeName.SNAPCARDS_TURN, CLZNoticeName.STAND_UP_RSP, CLZNoticeName.CUR_POT, CLZNoticeName.SITDOWN_RSP, CLZNoticeName.SITDOWN_RSP, CLZNoticeName.AGAIN_SIT_BUYIN_RES, CLZNoticeName.GAME_OVER_CHECK, CLZNoticeName.SHOW, CLZNoticeName.FAST_SIT_DOWN];
		}

		override public function handleNotification(notification:INotification):void
		{
			var data:*=notification.getBody();
			switch (notification.getName())
			{
				case CLZNoticeName.OPERATION_PALYER:
				{
					GameData._nCurSeatId=data.seatId;
					if (data.seatId != this._global.seatId)
					{
						return;
					}
					//轮流到当前人
					SoundManage.playSound("Tip");
					this.playerVo=this._inRoomData.getSitPlayerBySeatId(data.seatId);
					trace("轮流到,operate" + this.playerVo.name);
					this.step=data.step;
					this.operatePlayer(data.minCall, data.maxRaise, data.minRaise, data.stake, this.playerVo.callChip, GameData._objRoom.maxStake);
					break;
				}
				case CLZNoticeName.OPERATION_SUCC:
				{
					GameData._nCurSeatId=0;
					if (data.seatId == this._global.seatId)
					{
						this._nAuto=0;
						if (data.lastAction == GameData.FOLD || data.lastAction == GameData.ALLIN)
						{
							this.hideBtn(false);
						}
						else
						{
							this.hideBtn();
						}
					}
					break;
				}
				//三次翻牌将,喊注清0
				case CLZNoticeName.SNAPCARDS_FLOP:
				{
					if (this._global.seatId == 0)
					{
						return;
					}
					this.playerVo=this._inRoomData.getSitPlayerBySeatId(this._global.seatId);
					this.playerVo.callChip=0;
					break;
				}
				case CLZNoticeName.SNAPCARDS_RIVER:
				{
					if (this._global.seatId == 0)
					{
						return;
					}
					this.playerVo=this._inRoomData.getSitPlayerBySeatId(this._global.seatId);
					this.playerVo.callChip=0;
					break;
				}
				case CLZNoticeName.SNAPCARDS_TURN:
				{
					if (this._global.seatId == 0)
					{
						return;
					}
					this.playerVo=this._inRoomData.getSitPlayerBySeatId(this._global.seatId);
					this.playerVo.callChip=0;
					break;
				}
				case CLZNoticeName.STAND_UP_RSP:
				{
					if (this._global.seatId == data.seatId)
					{
						this.setFastBuyInVisible(0);
					}
					else
					{
						this.setFastBuyInVisible(this._global.seatId);
					}
					break;
				}
				case CLZNoticeName.SITDOWN_RSP:
				{
					playerVo=notification.getBody() as PlayerVo;
					if (playerVo.userid == this._global.userInfo.userVo.userid)
					{
//						this.mcOperate.fastBuyIn_btn.addEventListener(MouseEvent.CLICK, this.fastBuyInHandler);
						this.mcOperate.fastBuyIn_btn.visible=true;
					}
					this.setFastBuyInVisible(this._global.seatId);
					break;
				}
				case CLZNoticeName.CUR_POT:
				{
					if (this._global.seatId != 0)
					{
						this._nAuto=0;
						this.playerVo=this._inRoomData.getSitPlayerBySeatId(this._global.seatId);
						if (this.playerVo.state == GameData.PLAYING_GAME)
						{
							if (this.playerVo.lastAction != GameData.FOLD)
							{
							}
						}
						if (this.playerVo.lastAction == GameData.ALLIN)
						{
							this.hideBtn(false);
						}
						else
						{
							this.hideBtn();
						}
					}
					break;
				}
				case CLZNoticeName.SITDOWN_RSP:
				case CLZNoticeName.AGAIN_SIT_BUYIN_RES:
				{
					if (this._global.seatId == data.seatId)
					{
						this.setFastBuyInVisible(this._global.seatId);
					}
					break;
				}
				case CLZNoticeName.GAME_OVER:
				case CLZNoticeName.GAME_OVER_CHECK:
				case CLZNoticeName.SHOW:
				{
					this.hideBtn(false);
					break;
				}
				case CLZNoticeName.FAST_SIT_DOWN:
				{
					this.fastBuyInHandler(null);
					break;
				}
				case CLZNoticeName.SETROOMINFO_RSP:
				{
//					this.mcOperate.fastBuyIn_btn.addEventListener(MouseEvent.CLICK, this.fastBuyInHandler);
					this.mcOperate.fastBuyIn_btn.visible=true;
					break;
				}
				case CLZNoticeName.SITDOWN_ERR:
				{
//					this.mcOperate.fastBuyIn_btn.addEventListener(MouseEvent.CLICK, this.fastBuyInHandler);
					this.mcOperate.fastBuyIn_btn.visible=true;
					break;
				}
				case CLZNoticeName.SET_ROOM_WINDOS_SHOW:
				case CLZNoticeName.BUY_IN_WINDOS_SHOW:
				{
					//玩家点了坐下，快速买入禁用					
//					this.mcOperate.fastBuyIn_btn.removeEventListener(MouseEvent.CLICK, this.fastBuyInHandler);
					this.mcOperate.fastBuyIn_btn.visible=false;
					break;
				}
				case CLZNoticeName.SET_ROOM_WINDOS_CLOSE:
				case CLZNoticeName.BUY_IN_WINDOS_CLOSE:
				{
					this.mcOperate.fastBuyIn_btn.visible=true;
					break;
				}
				default:
				{
					break;
				}
			}
			return;
		}

		/**
		 * 快速快速
		 * @param event
		 */
		private function fastBuyInHandler(event:MouseEvent):void
		{
			if (this._global.seatId != 0)
			{
//				this.mcOperate.fastBuyIn_btn.removeEventListener(MouseEvent.CLICK, this.fastBuyInHandler);
				this.mcOperate.fastBuyIn_btn.visible=false;
				this.playerVo=this._inRoomData.getSitPlayerBySeatId(this._global.seatId);
				this.sendNotification(CLZNoticeName.AGAIN_SIT_BUYIN, {seatId: this._global.seatId, money: GameData._objRoom.minBlind});
			}
			else
			{
				var arrRoomSeat:Array=null;
				var newSeatIndex:int=0;
				var index:int=0;
				var newPlayerVo:PlayerVo=null;
				arrRoomSeat=GameData.getRoomSit(GameData._objRoom.seat);
				newSeatIndex=0;
				while (index < arrRoomSeat.length)
				{
					newPlayerVo=this._inRoomData.sitAllPlayer[(arrRoomSeat[index] - 1)] as PlayerVo;
					if (newPlayerVo == null)
					{
						newSeatIndex=arrRoomSeat[index];
						break;
					}
					index=index + 1;
				}
				if (newSeatIndex != 0)
				{
//					this.mcOperate.fastBuyIn_btn.removeEventListener(MouseEvent.CLICK, this.fastBuyInHandler);
					this.mcOperate.fastBuyIn_btn.visible=false;
					if (this._inRoomData.isEmpty)
					{
						GameData.lastSeat=newSeatIndex;
						var roomid:int=GameData._objRoom.id;
						trace("[seatmediator]第一个坐下的人，设置房间基础信息,roomid:" + roomid);
						this.sendNotification(CLZNoticeName.SET_ROOM_WINDOS_SHOW, {roomid: roomid}); //点坐位,显示买入
					}
					else
					{
						this.sendNotification(CLZNoticeName.SITDOWN, {seatId: newSeatIndex, money: GameData._objRoom.minStake});
//						this.sendNotification(CLZNoticeName.BUY_IN_WINDOS_SHOW, {seatId: seatId, againBuyIn: 0}); //点坐位,显示买入	
					}

//					this.sendNotification(CLZNoticeName.SITDOWN, {seatId: newSeatIndex, money: GameData._objRoom.minStake});
				}
				else if (this._global.judgeMoneyType(GameData._objRoom.type))
				{
					this.sendNotification(CLZNoticeName.SHOW_MOVE_TIP, {tip: GameData.tip["SIT_ERR_3"]});
				}
				else
				{
					this.sendNotification(CLZNoticeName.SHOW_MOVE_TIP, {tip: GameData.tip["SIT_ERR_4"]});
				}
			}
			return;
		}

		/**
		 * 快速买入显示
		 * @param seatId
		 */
		private function setFastBuyInVisible(seatId:int=0):void
		{
			var showSeatId:int=0;
			var arrShowSeatId:Array=null;
			var index:int=0;
			var buyPlayerVo:PlayerVo=null;
			if (!seatId)
			{
				showSeatId=0;
				arrShowSeatId=GameData.getRoomSit(GameData._objRoom.seat);
				index=0;
				while (index < arrShowSeatId.length)
				{

					buyPlayerVo=this._inRoomData.sitAllPlayer[(arrShowSeatId[index] - 1)] as PlayerVo;
					if (buyPlayerVo == null)
					{
						showSeatId=arrShowSeatId[index];
						break;
					}
					index=index + 1;
				}
				trace(showSeatId);
				if (showSeatId != 0)
				{
					/*if (this._global.judgeMoneyType(GameData._objRoom.type))
					{
						if (this._global.userInfo.userVo.money >= GameData._objRoom.min)
						{
							this.mcOperate.fastBuyIn_btn.visible=true;
							this.hideBtn();
							this.mcOperate.fastBuyIn_btn.buyIn_txt.text=GameData.tip["BUYIN_FAST_SIT"] + "：" + GameData._objRoom.min.toString();
						}
						else
						{
							this.mcOperate.fastBuyIn_btn.visible=false;
						}
					}
					else*/
					if (this._global.userInfo.userVo.money >= GameData._objRoom.minStake)
					{
						this.mcOperate.fastBuyIn_btn.visible=true;
						this.hideBtn();
						this.mcOperate.fastBuyIn_btn.buyIn_txt.text=GameData.tip["BUYIN_FAST_SIT"] + "：" + GameData._objRoom.minStake.toString();
					}
					else
					{
						this.mcOperate.fastBuyIn_btn.visible=false;
					}
				}
				else
				{
					this.mcOperate.fastBuyIn_btn.visible=false;
				}
			}
			else
			{
				this.mcOperate.fastBuyIn_btn.visible=false;
			}
			return;
		}

		private function get mcOperate():Object
		{
			return viewComponent;
		}

	}
}
